/**
 * 所有组件优化的全部放这里面
 * 这里是为了组件优化提高浏览器性能特意抽离出来的组件
 * 包含公共组件、业务组件
 * branchName: f-LazyloadComponent-qixiaofei
 * time: 2020/06/16
 * */

/**
 * 业务组件
 * */
const component = Object.create(null)
component.install = function (vue) {
  //主站  首页用到业务的组件
  const indexHeader = r => require.ensure([], () => r(require('@/components/page/index/indexheader')), 'indexHeader') // 顶部轮播图
  const veteransZone = r => require.ensure([], () => r(require('@/components/page/index/veteransZone')), 'veteransZone') // 退役军人专区
  const hotposts = r => require.ensure([], () => r(require('@/components/page/index/hotposts')), 'hotposts') // 热门职位
  const militaryArea = r => require.ensure([], () => r(require('@/components/page/index/militaryArea')), 'militaryArea') // 退役军人专区
  const graduationZone = r => require.ensure([], () => r(require('@/components/page/index/graduationZone')), 'graduationZone') // 退役军人专区
  const hotCompanies = r => require.ensure([], () => r(require('@/components/page/index/hotCompanies')), 'hotCompanies') // 热门公司
  const announcement = r => require.ensure([], () => r(require('@/components/page/index/announcement')), 'announcement') // 站点公告
  const rightPopover = r => require.ensure([], () => r(require('@/components/page/index/rigitPopover')), 'rightPopover') // 右侧菜单导航栏
  const footerMenu = r => require.ensure([], () => r(require('@/components/home/footerMenu')), 'footerMenu') //  底部菜单导航栏
  const homeNav = r => require.ensure([], () => r(require('@/components/home/nav')), 'homeNav') //  首页导航路由
  const home_search = r => require.ensure([], () => r(require('@/components/home/search')), 'home_search') // 主站查询框
  const home_header = r => require.ensure([], () => r(require('@/components/home/header')), 'home_header') // 主站查询框
  //主站  找工作用的业务组件
  const publicLogin = r => require.ensure([], () => r(require('@/components/page/index/publicLogin')), 'publicLogin') // 主站查询框
  // 职位详情地图
  const maps = r => require.ensure([], () => r(require('@/components/common/maps')), 'maps') // 主站查询框
  //主站  企业详情页下面的推荐职位组件sss
  const recruitPosition = r => require.ensure([], () => r(require('@/components/page/index/recruitPosition.vue')), 'recruitPosition'); // 主站推荐职位
  // 主站 企业风采
  const companyStyle = r => require.ensure([], () => r(require('@/components/page/companyStyle/companyStyle.vue')), 'companyStyle');
  // 注册全局组件
  vue.component('index-header', indexHeader) // 顶部轮播图相关
  vue.component('veteransZone', veteransZone) // 退役军人专区
  vue.component('hotposts', hotposts) // 热门职位
  vue.component('militaryArea', militaryArea) // 退役军人专区
  vue.component('graduationZone', graduationZone) // 退役军人专区
  vue.component('hotCompanies', hotCompanies) // 热门公司
  vue.component('announcement', announcement) // 站点公告
  vue.component('rightPopover', rightPopover) // 右侧菜单导航栏
  vue.component('footerMenu', footerMenu) // 底部菜单导航栏
  vue.component('home_nav', homeNav) // 首页导航路由
  vue.component('home_search', home_search) // 主站查询框
  vue.component('home_header', home_header)
  vue.component('Login', publicLogin)
  vue.component('maps', maps)
  vue.component('recruitPosition', recruitPosition)
  vue.component('companyStyle', companyStyle)
}

// 导出组件
export default component